package com.hzw.service.impl;

import com.hzw.bean.RotationChart;
import com.hzw.dao.RotationChartMapper;
import com.hzw.service.AdminService;
import com.hzw.utils.UUIDUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2019/4/5.
 */
@Service
public class AdminServiceImpl implements AdminService {
    @Resource
    private RotationChartMapper rotationChartMapper;

    @Override
    public int updateRotationChart(RotationChart rotationChart) {
        return rotationChartMapper.updateByPrimaryKeySelective(rotationChart);
    }

    @Override
    public void addRotationChart(RotationChart rotationChart) {
        String id = UUIDUtils.getUUID();
        rotationChart.setId(id);
        rotationChartMapper.insertSelective(rotationChart);
    }

    @Override
    public List<RotationChart> selectAllRotationChart() {
        return rotationChartMapper.selectAllRotationChart();
    }

    @Override
    public int deleteRotationChartById(String id) {
        return rotationChartMapper.deleteRotationChartById(id);
    }
}
